<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('请假申请')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-post-add">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">用户名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="postName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">请假原因：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="originalPrice" id="postCode" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">开始时间：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="startTime"  placeholder="yyyy-MM-dd HH:mm" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">结束时间：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="endTime"  placeholder="yyyy-MM-dd HH:mm" required>
				</div>
			</div>

			<input type="hidden" name="bpmnInfoId" th:value="${bpmnInfo!=null?bpmnInfo.id:''}">
			<div class="form-group">
				<label class="col-sm-3 control-label">审核流程：</label>
				<div class="col-sm-8">
					<input name="bpmnInfoId" th:value="${bpmnInfo!=null?bpmnInfo.bpmnName:''}" class="form-control" type="text" readonly disabled="disabled">
				</div>
			</div>

			<div class="form-group" id="directorId">
				<label class="col-sm-3 control-label">审核人(店长)：</label>
				<div class="col-sm-8">
					<select name="autitor.id" class="form-control m-b" >
						<option th:each="u : ${directors}" th:text="${u.userName}" th:value="${u.id}"></option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">备注：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="info" class="form-control valid"></textarea>
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="common/include :: footer" />
	<th:block th:include="common/include :: datetimepicker" />
	<script type="text/javascript">
		var prefix = ctx + "/business/leave";
		
		
		function submitHandler() {
	        if ($.validate.form()) {
				// 保存信息 刷新表格
	        	// 若依的save方法，参数1：提交的地址 参数2：提交带的数据 参数3：回调函数（这里没有传）
	        	$.operate.save(prefix + "/add", $('#form-post-add').serialize());
	        }
	    }
		// 添加时间格式代码
		$("input[name='startTime']").datetimepicker({
			format: "yyyy-mm-dd hh:ii",
			autoclose: true
		});
		$("input[name='endTime']").datetimepicker({
			format: "yyyy-mm-dd hh:ii",
			autoclose: true
		});
	</script>
</body>
</html>
